package com.xzc.java8.B_Stream.g_find;

import java.util.ArrayList;
import java.util.List;

public class NoneMatchTest {

    public static void main(String[] args) {
        List<Apple> list0 = new ArrayList<>();
        Apple a0 = new Apple("blue");
//        Apple a1 = new Apple("blue");
        Apple a1 = new Apple("blue");
//        Apple a2 = new Apple("yellow");
        Apple a2 = new Apple("blue");
        Apple a3 = new Apple("red");
        list0.add(a0);
        list0.add(a1);
        list0.add(a2);
        list0.add(a3);

        if (list0.stream().noneMatch(Apple::isRedApple)) {
            System.out.println("这里没有一个红苹果");
        } else {
            System.out.println("这里有一些是红苹果");
        }
    }
}
